import java.awt.Point;
import java.util.ArrayList;

import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;


public class Main {
	private DataBaseManager DB_manager;
	private ExcelManager Excel_manager;
	
	public Main()
	{
		DB_manager = new DataBaseManager();
		Excel_manager = new ExcelManager();
	}
	public ArrayList<Object[]>  OpenData(String Path,int indexNum,int x1, int y1, int x2, int y2) // get from DB. and display on the window then ask to export to Excel
	{
		Workbook wb =  Excel_manager.openReadExcelFile(Path);
		Sheet sheet = Excel_manager.getReadWorksheet(wb, indexNum);
		
		return Excel_manager.readDataOnSheet(sheet, new Point(x1,y1), new Point(x2,y2));
	}
	private boolean DatabaseToExcel()
	{
		return true;
	}
	public boolean EditData()
	{
		return true;
	}
	public boolean SaveData(String which)
	{
		if(which.contains("Excel")) return ExcelToDatabase();
		else if(which.contains("Customer")) return CustomerToDatabase();
		
		return false;
	}
	private boolean ExcelToDatabase()
	{
		return true;
	}
	private boolean CustomerToDatabase()
	{
		return true;
	}
}
